package com.RMP
{
    import flash.display.*;
    import com.greensock.*;
    import com.greensock.easing.*;

    public class LoaderBar extends Sprite
    {
        public var progressSprite:Sprite;
        public var bgSprite:Sprite;
        public var myWidth:Number;
        var myRoot:MovieClip;
        var myHeight:Number;

        public function LoaderBar(param1:MovieClip, param2:Number, param3:Number, param4:uint, param5:uint)
        {
            myRoot = param1;
            myWidth = param2;
            myHeight = param3;
            bgSprite = new Sprite();
            bgSprite.graphics.beginFill(param4);
            bgSprite.graphics.drawRect(0, 0, myWidth, myHeight);
            this.addChild(bgSprite);
            if (param5 == 16777215)
            {
                bgSprite.alpha = 0;
            }
            progressSprite = new Sprite();
            progressSprite.graphics.beginFill(param5);
            progressSprite.graphics.drawRect(0, 0, 1, myHeight);
            progressSprite.width = 0;
            this.addChild(progressSprite);
            return;
        }

        public function tweenTo(param1:Number, param2:Number) : void
        {
            TweenMax.to(progressSprite, param2, {width:param1, ease:Quad.easeOut, overwrite:true});
            return;
        }

        public function finishTween(param1:Number) : void
        {
            TweenMax.to(progressSprite, param1, {width:myWidth, ease:Quad.easeOut, overwrite:true});
            return;
        }

    }
}
